home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / filutil / dirto409.zip / DIRTOTAL.DOC < prev    next >
Text File  |  1994-09-09  |  19KB  |  402 lines

  1. DIRTOTAL.DOC
  2. 09/09/94
  3.  
  4. The DIRTOTAL.EXE program is another directory-listing program.  It produces a
  5. text file with the results of your search and is primarily designed for
  6. inventory purposes.  It includes these features:
  7.  
  8.   * Can search an entire drive or part of a drive
  9.   * Can search multiple drives
  10.   * Can look for individual files or all files
  11.   * Can select based on attributes, date, or size
  12.   * Can extract information for archive files (ZIP, LZH, etc)
  13.   * Can look for duplicate file names
  14.   * Can produce a couple of different report formats
  15.   * Works on a CD-ROM and network drives
  16.  
  17. DIRTOTAL goes through all directories on a given drive (or on multiple drives)
  18. and writes out the names and space used for all files on that drive.  You
  19. will also see directory totals and such.  (You can suppress the individual file
  20. names listing if you want.)
  21.  
  22. Alternatively, you can have the utility restrict the search to just those files
  23. within a given subdirectory and its child subdirectories.  For example, if you
  24. had a directory structure like this:
  25.  
  26.         +-- DOS
  27.         +-- TC -+-- KERMIT
  28.         |       +-- BANYAN
  29.         +-- 123
  30.  
  31. If you pass in just the drive designation, you will get files in all
  32. subdirectories.  If you pass in "C:\TC", you'll get all files in C:\TC,
  33. C:\TC\KERMIT, and C:\TC\BANYAN.
  34.  
  35. DIRTOTAL then tries to total up the space used by subdirectory as well as for
  36. the entire disk.  The routine also presents subtotals for directories with
  37. children.  For networked and CD-ROM discs, it will typically present the wrong
  38. results when it comes to total disk space and total free space but the file and
  39. directory totals will all be correct.
  40.  
  41. DIRTOTAL creates an output file in the default directory on the C: drive called
  42. "DRIVE#s.DIR" (where "s" is the letter of the drive you scanned) which contains
  43. the file listings and total size reports.  If you restrict the output to a
  44. specific subdirectory and its children, the file name created will be called
  45. "DRIVE#sx.DIR", where "x" is the first letter of the restriction ("DIRTOTAL
  46. C:\TC" would create a file called "DRIVE#CT.DIR").  If you ask for more than one
  47. drive at a time (e.g. "DIRTOTAL C: D: E:"), the file name will put the number of
  48. drives scanned in place of the drive letter (so "DIRTOTAL C: D: E: \TC" would
  49. create a file called "DRIVE#3T.DIR").
  50.  
  51. The DIRTOTAL.EXE program was originally written in order to find out how much space the
  52. various files took on a CD-ROM disc.  However, the command also works fine on
  53. large disk drives and network drives.  It was modeled after Norton's FF (File
  54. Find) command.
  55.  
  56.  
  57. Note:  When examining the output report, you may find some weirdly-named
  58. eight-character file names (typically beginning with "A" or "B") in your root
  59. directory.  Typically, these will show up if you run DIRTOTAL on your C drive.
  60. These files are temporary ISAM files created by the routine.  They are deleted
  61. once the program is run.
  62.  
  63.  
  64. The DIRTOTAL.INI file:
  65.  
  66. DIRTOTAL will read a DIRTOTAL.INI file if one is found.  (You can specify a
  67. different file name if desired.) The file is an ASCII text file that can be
  68. created maintained by hand.  The file can consist or one or more command line
  69. parameters (only those that begin with a "/"), one statement per line.
  70.  
  71. The file can also contain comments which are blank lines or any line beginning
  72. with:
  73.         ;    (semi-colon)
  74.         :    (colon)
  75.         '    (quote)
  76.  
  77. DIRTOTAL looks for the initialization file in your default subdirectory first.
  78. It then searches for it in the subdirectory where the executable was and then
  79. goes through your DOS path.
  80.  
  81. Passing in "/-I" or "/INULL" skips loading the DIRTOTAL.INI file.
  82.  
  83.  
  84. CONFIGWS.EXE:
  85.  
  86. In addition to using the DIRTOTAL.INI file, you can permanently change some
  87. defaults within DIRTOTAL.EXE by using the CONFIGWS.EXE program.  CONFIGWS.EXE is
  88. not included in the DIRTOTAL distribution package but previous versions can
  89. typically be used with DIRTOTAL if desired.  (The same CONFIGWS.EXE program can
  90. be used to path a number of Wayne Software programs.) If CONFIGWS can't patch
  91. the executable, it will notify you of this before altering anything.
  92.  
  93. CONFIGWS.EXE allows you to set the following defaults:
  94.  
  95.         Noise:          /BEEP or /-BEEP
  96.         Sub sub totals: /SUB1 or /-SUB1
  97.         Sub cum totals: /SUB2 or /-SUB2
  98.         File sizes as:  /CLUSTERS or /-CLUSTERS
  99.         Listing order:  /ON, /O-N, /OS, /O-S, /OD, /O-D, /OO
  100.         Report format:  /NORMAL, /WIDE, /THIN, or /SPLIT
  101.  
  102. When setting options, the program will process defaults in the following order:
  103.   (1) CONFIGWS.EXE-settable settings
  104.   (2) DIRTOTAL.INI settings
  105.   (3) command-line settings
  106.  
  107. The *last* settings encountered win.
  108.  
  109.  
  110.  
  111. Syntax:
  112.  
  113.     DIRTOTAL [ [ drive: ] ... [drive:][filespec] |
  114.         [ drive: ] ... [drive:]\path[\filespec] ]
  115.       [ /NORMAL | /WIDE | /THIN | /SPLIT ] [ /DUPS ] [ /CHILD ]
  116.       [ /NL ] [ /-HEADERS ] [ /-FOOTERS ] [ /CLUSTERS | /-CLUSTERS ]
  117.       [ /S { GT | GE | LT | LE | EQ | NE } value ]
  118.       [ /D { GT | GE | LT | LE | EQ | NE } mm/dd/yy ] [ /ATTR=attr ]
  119.       [ /Frptfile ] [ /Z | /-Z ] [ /Z2 | /-Z2 ] [ /Iinitfile | /-I ]
  120.       [ /SUB1 | /-SUB1 ] [ /SUB2 | /-SUB2 ] [ /+DIR | /-DIR ] [ /n ]
  121.       [ /Ox | /O-x ] [ /BEEP | /-BEEP ] [ /Td: ] [ /Q ] [ /? ]
  122.  
  123. where:
  124.  
  125. "drive" is the letter of the drive you want to scan ("C", "D", "L", etc).  If no
  126. drive is specified, the routine presumes you want all files from your default
  127. drive.  You can specify multiple drives if you want.
  128.  
  129. "filespec" restricts the listing to files that meet some file specification.
  130. The restriction can include wildcards.  For example, "DIRTOTAL C:\*.BAS".  Note
  131. that you can put a space between the drive and the path/filespec but not within
  132. the path/filespec (don't try "DIRTOTAL C:  \TC *.BAS" but "DIRTOTAL C:
  133. \TC\*.BAS" and "DIRTOTAL C:\TC\*.BAS" are fine).  (One quirk:  If you specify a
  134. filespec, the program will not show parent subdirectory totals for parent
  135. subdirectories that are empty.)
  136.  
  137. "path" restricts the listing to a subdirectory and its children.
  138.  
  139. "/NORMAL" is typically the default report format although this can be changed
  140. using CONFIGWS.  It produces a report which is 80-characters wide and has the
  141. complete file name listed on each line like this:
  142.  
  143. C:\ACD.IDX                                      09/26/93 00:34:50        575  a
  144. C:\AUTOEXEC.BAT                                 08/20/93 00:08:42        845  a
  145. C:\BOOT.CPS                                     05/06/93 18:56:28      1,024h
  146. C:\CHKLIST.CPS                                  05/20/93 22:23:06        135  a
  147. C:\CMOS.CPS                                     05/06/93 18:56:28         48
  148.  
  149. Note the last four characters show any special attributes set for the file:
  150.         a = archive bit set (the file hasn't been backed up yet)
  151.         h = hidden bit set
  152.         s = system file bit set
  153.         r = read-only file bit set
  154.  
  155.  
  156. "/WIDE" produces a 126-character wide report with all of the information in
  157. fixed columns.  This is fine for compressed printing or subsequent processing by
  158. some other program.  The field positions are as follows:
  159.  
  160.         cols  1- 65 path (including drive)
  161.              67- 78 filename (or ZIP name)
  162.              80- 91 ZIP member name (if any)
  163.              93-100 file creation date
  164.             102-109 file creation time
  165.             111-121 file size in bytes
  166.             123-126 attributes
  167.  
  168. This option invokes /Z although you can specify /-Z if you want to override it.
  169. This option is primarily designed for people who need a complete catalog of
  170. everything in a CD-ROM and programs like CATDISK choke if you exceed 4000 files
  171. per disc.
  172.  
  173. "/THIN" produces a smaller report.  The directory name is printed separately
  174. from the file name.  It automatically invokes the /CHILD option and produces a
  175. report similar to this:
  176.  
  177. C:\
  178.   ACD.IDX                   09/26/93 00:34:50         575   a
  179.   AUTOEXEC.BAT              08/20/93 00:08:42         845   a
  180.   BOOT.CPS                  05/06/93 18:56:28       1,024 h
  181.   CHKLIST.CPS               05/20/93 22:23:06         135   a
  182.  
  183. "/SPLIT" creates the results file with the filename in a fixed field within the
  184. file.  If the subdirectory name doesn't fit, it's truncated.  The /WIDE
  185. option is better if your subdirectory names exceed 35 characters (if /Z is
  186. not used) or 22 characters (if /Z is used) unless you're particular about
  187. having 80-character or less reports.  A sample of the output with /Z:
  188.  
  189. D:\CLONE22\           PB22OBJ.LZH  ADDMATI.OBJ  05/01/93 11:14:58        124
  190. D:\CLONE22\           PB22OBJ.LZH  ADDMATL.OBJ  05/01/93 11:14:58        132
  191. D:\CLONE22\           PB22OBJ.LZH  ALLEXTME.OBJ 05/01/93 11:14:58        110
  192. D:\CLONE22\           PB22OBJ.LZH  ALTKEY.OBJ   05/01/93 11:11:54      1,282
  193.  
  194. "/DUPS" produces a report which shows all files with the same file names on
  195. your disk.  By default, it produces a report that's a modified version of the
  196. /THIN report:
  197.  
  198. CHKLIST.CPS
  199.   C:\                                           05/20/93 22:23:06        135  a
  200.   C:\DOS\                                       06/27/93 21:17:12        999  a
  201.   C:\TC\KERMIT\                                 05/06/93 19:02:22        108  a
  202.   C:\TC\TELIX\                                  07/10/93 10:28:22        135  a
  203.  
  204. /DUPS is incompatible with the /SUB, /CHILD, or /NL options.  If you
  205. want to override the default /THIN report format using /DUPS, you have to
  206. specify the report format after the /DUPS option (e.g. "DIRTOTAL /DUPS
  207. /NORMAL"), not before ("DIRTOTAL /NORMAL /DUPS" will ignore the /NORMAL option).
  208. CONFIGWS default table formats are ignored if /DUPS is specified.
  209.  
  210.  
  211. "/CHILD" produces a listing with directory subtotals intermixed with the regular
  212. file names.  This is useful for visual effect but a problem if you use the
  213. file as input into something else.  The option is automatically invoked for
  214. /THIN reports.  A sample:
  215.  
  216. C:\FATE\
  217.   ATLANTIS.INI              08/20/93 23:17:56         229   a
  218.   SAVEGAME.001              08/20/93 23:30:54      45,334   a
  219.     Total    2 files      45,563 bytes in C:\FATE\
  220.  
  221. "/NL" eliminates the listing of individual file names and sizes and simply gives
  222. you the subdirectory totals.  This option overrides the /Z specification.  This
  223. option is also incompatible with the /DUPS option.
  224.  
  225. "/-HEADERS" skips writing out the first couple of introductory lines in the
  226. output file which describe what options were used and such.  This is mainly of
  227. use if you plan to process the output file electronically.
  228.  
  229. "/-FOOTERS" skips writing out the summary information at the end of the output
  230. file.  This includes the directory totals and such.  This is mainly of use if
  231. you plan to process the output file electronically.
  232.  
  233. "/CLUSTERS" says to show file sizes in terms of cluster sizes (space allocated)
  234. instead of the normal bytes used.  DOS typically shows things in terms of
  235. bytes used.  Note that clusters aren't all that relevant on compressed drives
  236. or in the contents of compressed files.
  237.  
  238. "/-CLUSTERS" says to show file sizes in terms of bytes used.  This is how DOS
  239. normally shows things.  Is typically the default but you can change it using
  240. the CONFIGWS program.
  241.  
  242. "/S xx value" says you want to limit the list of individual files to those
  243. which meet a certain size requirement.  Due to DOS's redirection commands,
  244. relations like ">" and "<" don't work so you have to use the two-letter
  245. abbreviations:
  246.  
  247.         GT      greater than                    >
  248.         GE      greater than or equal to        >=
  249.         LT      less than                       <
  250.         LE      less than or equal to           <=
  251.         EQ      equal to                        =
  252.         NE      not equal to                    <>
  253.  
  254. Having said that, the only two you're likely to use are GT and GE.  The "value"
  255. is the size value you want tested for.  So "SPACE GT 1000000" would find all
  256. individual files with a filesize greater than one million bytes.  Note that the
  257. directory total information will still indicate all files, not just the ones
  258. which meet your size limitation request.
  259.  
  260. "/D xx mm/dd/yy" says to show only those files created before or after a given
  261. date.  As before, you have to use GT, GE, LT, LE, EQ, and NE for the relational
  262. operator.  "/D GE 10/01/91" would show only those files created on or after
  263. October 1, 1991.
  264.  
  265.  
  266. "/ATTR=attr" restricts the listing to just those files with a certain attribute
  267. setting.  Valid attributes are "H" (hidden), "A" (archived), and "S" (system).
  268. So "DIRTOTAL C:\ /ATTR=A" would find all files that haven't been backed up yet.
  269.  
  270. "/Frptfile" says to write the results to a given file name.  By default, the
  271. results with go to C:DRIVE#ds.DIR, where "d" is the drive letter and "s" is the
  272. first letter of any path restriction used.  So "DIRTOTAL C:\*.*" would default
  273. to /FC:DRIVE#C.DIR.  You can say /FSCRN: if you want.  "DIRTOTAL C: /FSCRN: /NL"
  274. is useful.
  275.  
  276. "/Z" shows the contents of any ZIP, ARC, ARJ, LZH, PAK, or ZOO file too.  Is
  277. automatically invoked if /WIDE is specified.
  278.  
  279. "/-Z" reverses /Z and is the default unless /WIDE is specified.
  280.  
  281. "/Z2" checks each .EXE file to see if it's a self-extracting file.  If it is,
  282. it shows the contents of these files too.  /Z2 automatically invokes /Z by
  283. default as well.
  284.  
  285. "/-Z2" reverses /Z2 and is typically the default.
  286.  
  287. "/Iinitfile" says to read an initialization file with the file name "initfile".
  288. The file specification *must* contain a period.  If no drive or path information
  289. is specified, the program will search for initfile beginning in your default
  290. subdirectory and then going throughout your DOS path.  The use of an
  291. initialization file is optional.  Initially defaults to "/IDIRTOTAL.INI".
  292.  
  293. "/-I" (or "/INULL") says to skip loading the DIRTOTAL.INI initialization file.
  294.  
  295. "/SUB1" gives you subdirectory totals (how many bytes/files are in this
  296. subdirectory).  This option is only relevant if the /THIN option isn't used;
  297. /THIN automatically interweaves subdirectory totals within the listing.  This is
  298. typically the default but you can change it using CONFIGWS.EXE.
  299.  
  300. "/SUB2" gives you cumulative subdirectory subtotals (including how many files
  301. and bytes are in subdirectories this level and below).  This is typically the
  302. default but you can change it using CONFIGWS.EXE.
  303.  
  304. "/-SUB2" suppresses the printing of cumulative subdirectory subtotals.
  305.  
  306. "/+DIR" includes directories in the file count summary at the end of the report.
  307. This corresponds to what DOS shows when you do a DIR and is apparently useful on
  308. a Novell network.  The default is /-DIR.
  309.  
  310. "/-DIR" drops directories from the file count summary.  This is the default.
  311.  
  312. "/n" confines the subdirectory total list to only those entries at the nth level
  313. subdirectory and below.  "/n" can be any single-digit value between 0 (only
  314. those files in the root) and 9 (typically all of them).  For example, "/1" would
  315. only show the directories off the root, not the subdirectories off of these
  316. directories.  Note that this parameter affects the printing of the directories,
  317. not the file count/size calculations.  The /SUB2 listing will show the
  318. directory including all child subdirectories even if those subdirectories do not
  319. in fact print.
  320.  
  321.  
  322. "/Ox" and "/O-x" allow you to specify the display order for the files.  "x" can
  323. be one of the following:
  324.  
  325.         N = file name (exclusive of directory name)
  326.         D = file date and time
  327.         S = file size of the original (non-compressed) file
  328.         O = original order (in order of directory, then filename)
  329.  
  330. If you precede the "x" with a dash ("-"), the sort will be done in reverse
  331. order.  Defaults to /OO but this can be altered using CONFIGWS.EXE.  Note that
  332. the /THIN option automatically makes the directory name the prime sorting index.
  333.  
  334. "/BEEP" gives you a beep when the program finishes.
  335.  
  336. "/-BEEP" reverses /BEEP and is typically the default.  You can change this using
  337. the CONFIGWS.EXE program.
  338.  
  339. "/Td:" specifies the drive to write any temporary ISAM files that the routine
  340. needs.  ISAM data bases are used to store and sort the file names and directory
  341. totals.  ISAM files cannot be created reliably on certain types of drives.  If a
  342. /Td: specification (e.g.  "/TC:") is not specified, the routine checks each of
  343. the following drive specifications in order:
  344.   - the drive where the report is being written to (using the /Frptfile spec if
  345.     present)
  346.   - the default drive
  347.   - drive C
  348. In each case, the program tries to skip the drive if it's either removeable or
  349. a remote (network) drive.  The latter test is often incorrect.  After that, it
  350. tries to create a file on the drive; CD-ROM drives always fail that test.
  351.  
  352. "/Q" turns off the file-by-file status reporting that the routine does.
  353.  
  354. "/?" or "/HELP" or "HELP" shows you the syntax for the command.
  355.  
  356.  
  357. NOTE ON DISK SPACE:  By default, DIRTOTAL builds ISAM files with intermediate
  358. results on your C drive.  If you specify an /Frptfile parameter and include a
  359. drive specification, it will typically create the ISAM files there instead.  You
  360. can also specify the ISAM location using the /Td: parameter.  Some of the files
  361. can be huge if you have a big disk to total.
  362.  
  363.  
  364. Return codes:
  365.  
  366. DIRTOTAL returns the following ERRORLEVEL codes:
  367.         0 = no problems
  368.         1 = no files found or invalid drive
  369.       253 = user aborted early
  370.       254 = internal problem finding drive to write to
  371.       255 = syntax problems, or /? requested
  372.  
  373.  
  374.  
  375. Author:
  376.  
  377. This program was written by Bruce Guthrie of Wayne Software.  It is free for use
  378. and redistribution provided relevant documentation is kept with the program, no
  379. changes are made to the program or documentation, and it is not bundled with
  380. commercial programs or charged for separately.  People who need to bundle it in
  381. for-sale packages must pay a $50 registration fee to "Wayne Software" at the
  382. following address.
  383.  
  384. Additional information about this and other Wayne Software programs can be found
  385. in the file BRUCEymm.DOC which should be included in the original ZIP file.
  386. ("ymm" is replaced by the last digit of the year and the two digit month of the
  387. release.  BRUCE312.DOC came out in December 1993.  This same naming convention
  388. is used in naming the ZIP file that this program was included in.) Comments and
  389. suggestions can also be sent to:
  390.  
  391.                 Bruce Guthrie
  392.                 Wayne Software
  393.                 113 Sheffield St.
  394.                 Silver Spring, MD 20910
  395.  
  396.                 fax: (301) 588-8986
  397.  
  398. See BRUCEymm.DOC file for additional contact information.
  399.  
  400. Foreign users:  Please provide an Internet e-mail address in all correspondence.
  401.  
  402.